{template header}
<script>
$(document).ready(function() {

//选择城市
$('#provinceid').change(function(){

	var provinceid = $(this).children('option:selected').val();  //弹出select的值

	//ajax
	$.ajax({
		type: "GET",
		url:  "index.php?app=user&ac=do&ts=city&provinceid="+provinceid,
		success: function(msg){
			$('#cityid').html(msg);

			var cityid = $("#cityid").children('option:selected').val();  //弹出select的值
			$.ajax({
				type: "GET",
				url:  "index.php?app=user&ac=do&ts=area&cityid="+cityid,
				success: function(msg){
					$('#areaid').html(msg);
				}
			});
		}
	});
	
});

//选择区县
$('#cityid').change(function(){

	var cityid = $(this).children('option:selected').val();  //弹出select的值
	//ajax
	$.ajax({
		type: "GET",
		url:  "index.php?app=user&ac=do&ts=area&cityid="+cityid,
		success: function(msg){
			$('#areaid').html(msg);
		}
	});
	
});

});
</script>

<!--main-->
<div class="midder">

{template set_menu}

<div class="utable">
<form method="POST" action="index.php?app=user&ac=do&ts=setcity">
<table cellpadding="5" cellspacing="5">

<tr><th valign="top">常居地：</th>
<td>
<!--{if $strUser[provinceid] =='0' || $strUser[cityid]=='0' || $strUser[areaid]=='0'}-->
火星
<!--{else}-->
{$strUser[province][provincename]} - {$strUser[city][cityname]} - {$strUser[area][areaname]}
<!--{/if}-->
<br />
<br />
<select id="provinceid" name="provinceid">
<!--{loop $arrProvince $key $item}-->
<option value="{$item[provinceid]}">{$item[provincename]}</option>
<!--{/loop}-->
</select>

<select id="cityid" name="cityid">
<!--{loop $arrCity $key $item}-->
<option value="{$item[cityid]}">{$item[cityname]}</option>
<!--{/loop}-->
</select>

<select id="areaid" name="areaid">
<!--{loop $arrArea $key $item}-->
<option value="{$item[areaid]}">{$item[areaname]}</option>
<!--{/loop}-->
</select>
</td>
</tr>


<tr><th></th><td><input type="submit" value="更新常居地"  /></td></tr>

</table>
</div>
</div>
{template footer}